﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PICCommands.IO
{
    public class DigitalOutChannels:List<DigitalOutChannel>,IToggleable
    {
        public void On()
        {
            foreach (var channel in this)
                channel.On();
        }

        public void Off()
        {
            foreach (var channel in this)
                channel.Off();
        }

        public void AddChannelsTo(IDictionary<string, IToggleable> outputs)
        {
            foreach (var channel in this)
                outputs.Add(channel.Id, channel);
        }
    }
}
